package com.expdatacloud.controller.store;

import com.expdatacloud.dto.ApiResponse;
import com.expdatacloud.entity.Lotxlocxid;
import com.expdatacloud.service.LotxlocxidService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

/**
 * 库存余额
 *
 * @author makejava
 * @since 2020-03-02 14:27:43
 */
@RestController
@RequestMapping("lotxlocxid")
public class LotxlocxidController {
    /**
     * 服务对象
     */
    @Resource
    private LotxlocxidService lotxlocxidService;

    @GetMapping("/list")
    @ResponseBody
    public ApiResponse list(@RequestParam(defaultValue = "1") int page, @RequestParam(defaultValue = "10") int limit,
                            Lotxlocxid lotxlocxid, HttpSession session) {
        PageHelper.startPage(page, limit);
        PageInfo<Lotxlocxid> pageInfo = new PageInfo<>(lotxlocxidService.list(lotxlocxid));
        return ApiResponse.ok(pageInfo.getTotal(), pageInfo.getList());
    }

}